package com.ly.report_ah.sercive.master.impl;

import com.ly.report_ah.dao.master.ReportMapper;
import com.ly.report_ah.dao.master.SmpSummaryMapper;
import com.ly.report_ah.entity.master.SmpSummary;
import com.ly.report_ah.sercive.master.DatService;
import com.ly.report_ah.sercive.master.ReportService;
import com.ly.report_ah.sercive.master.TestService;
import com.ly.report_ah.util.ConstatUtil;
import com.ly.report_ah.vo.*;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.Version;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static com.ly.report_ah.sercive.master.impl.DatServiceImpl.*;

@Service
@Slf4j
public class TestServiceImpl implements TestService {

    @Resource
    private ReportMapper reportMapper;
    @Autowired
    private ReportService reportServiceImpl;

    @Override
    public String test() {

        List<SmpSummary> summaryData = reportMapper.getSummaryData("773222054823747589", "DFPowerTransformer", "35").stream().filter(smpSummary ->
                smpSummary.getJudgeType().contains("持续重载")).collect(Collectors.toList());
        return reportServiceImpl.getInfoDetailList(summaryData.get(0));
    }
}
